<?php
        $atributos = array('id' => 'liquidacion_form', 'class' => 'form_liquidacion');
        echo form_open('liquidacion/calcular', $atributos);
        
        $data1=array(
            'name'=>'dni',
            'id'=>'dni',
            'value'=> set_value('dni'),
            'class'=>'sinput'
        );?>
<fieldset style="width: 500px;">
    <h1 style="margin-bottom: 25px;">Liquidacion</h1>


    <div style="margin-top: 30px;">
        <table cellspacing="0" border="0">
            <tr height="60px">
                <th style="font-size:1.8em">Trabajador:</th>
                <th><select name="comboEmpleado" id="select" style="width:150px;margin-top: -0.3em">
                        <option value="-1">Seleccionar</option>
                        <?php
                        foreach ($empleados as $i => $datos) {
                            echo "<option value='" . $datos['idEmpleado'] . "'>" . $datos['nombre'] . " " . $datos['apellido'] . "</option>";
                        }
                        ?>
                    </select></th>
            </tr>
            <tr height="60px">
                <th style="font-size:1.8em;">Fecha Inicio:</th>
                <th><div id="calendario" class="k-content" style="margin-top:-0.2em;margin-left: 1.5em;">
                <input class="datepicker" name="datepicker" />
            </div></th>
            </tr>
            <tr height="60px">
                <th style="font-size:1.8em;">Fecha Fin:</th>
                <th><div id="calendario" class="k-content" style="margin-top:-0.2em;margin-left: 1.5em;">
                <input class="datepicker" name="datepicker2" />
            </div></th>
            </tr>
        </table>
    </div>
<input type="submit" id="registrar" value="Calcular" />
   
</fieldset>
<fieldset style="width: 700px;">
        <?php
        if ($consulta == 0) {
            echo "<h2 style='text-align: center;'>No se selecciono ningun Empleado.</h2>";
        } else {?>
    
    <?php foreach($consulta as $i=>$nom){ }?>
    
    <h2 style="margin-bottom: 20px;">Calculo del Trabajo Realizado por el Empleado <?php echo $nom['nombre']." ".$nom['apellido'] ?></h2>
        <table id="tabla" cellspacing="0">
        
        <tr>
            <th class="elthini" style="width:200px;"><a class='bold' href="javascript:$('#tabla').sortTable({onCol: 1, keepRelationships: true, sortType: 'numeric'})" style="color:#333333;">Remito</a></th>
            <th class="elth" style="width:200px;"><a class='bold' href="javascript:$('#tabla').sortTable({onCol: 2, keepRelationships: true})" style="color:#333333;">Fecha</a></th>
            <th class="elthfin" style="width:200px;"><a class='bold' href="javascript:$('#tabla').sortTable({onCol: 3, keepRelationships: true, sortType: 'numeric'})" style="color:#333333;">Total Metro Cubicos</a></th>
       
        </tr>
        <?php foreach($consulta as $i=>$id){ ?>
        <tr>
            <td class="eltd" style="width: 100px;"><?php echo $id['id_remito'] ?></td>
            <td class="eltd" style="width: 100px;"><?php echo $id['fecha'] ?></td>
            <td class="eltd" style="width: 100px;"><?php echo $id['total'] ?></td>  
        </tr>
        <?php }?>
    </table>
    <?php $total=0; foreach($consulta as $i=>$sum){
        $total=$total+$sum['total'];
        }?>   
    <h2 style="margin-top: 20px;text-align: center;">Total de todos los Remitos: <?php echo $total ?> M³</h2>
    <? } ?>  
 </fieldset>  
<?php echo form_close() ?>